What day is it ? ThursDay Charge Admission
Since "ThursDay" <> "Thursday" is true,
the true block of the IF
statement is executed.
The TRUE/FALSE values of relational expression can be combined using AND and OR:
"Monday" <> "Thursday" AND "June" = "June" --------------------- --------------- true true --------------------------- true
Remember that AND
requires both relational expressions to be TRUE
for the entire logical expression to be TRUE.
If one or both relational expressions are FALSE, then the entire
logical expression is FALSE:
"Monday" <> "Thursday" AND "June" = "December" --------------------- --------------- true false --------------------------- false
Say that the art museum has a new policy: it will not charge admission on Thursdays and it will not charge admission during the month of August. Here is the changed program:
' Admission Checker ' August is now free ' PRINT "What day is it" INPUT DAY$ PRINT "What month is it" INPUT MONTH$ IF DAY$ <> "Thursday" AND MONTH$ <> "August" THEN PRINT "Charge Admission" ELSE PRINT "Free Day" END IF ' END
If the user enters "Monday" and "August" what will the program print?